
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Split Form Design</title>
<style>
.htmlForm td{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#CC3300;
    border-bottom:1px #EAE3C8 solid;
}
.htmlForm input,select{
    border:1px #BDB597 solid;
    font-family:tahoma;
    font-size:12px;
    padding:2px;
}
.points{
    font-family:tahoma;
    font-size:11px;
    color:#CC3300;
    padding-left:20px;
    padding-top:20px;
}
.points li{
    padding-top:5px;
}
.formHeading{
    font-family:Arial, Helvetica, sans-serif;
    font-size:16px;
    font-weight:bold;
    color:#CC3300;
    padding:10px;
}
</style>
</head>
<body>
<form action="../classes/Student.php?action=signup" method="post">
    <!-- The outter table to contain the form and the instruction panel -->
    <table width="650px" border="0" cellpadding="2px" cellspacing="1px" bgcolor="#FFCC66">
        <tr bgcolor="#C0C0C0">
            <td width="2px" bgcolor="#C0C0C0"></td>
            <td width="400px">
                <div class="formHeading">Registration Form</div>
                <!-- The inner table below is a container for form -->             
                <table width="100%" border="0" cellpadding="3px" class="htmlForm" cellspacing="0">
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                    <td align="left"><label for="username">Username</label></td>
        <td width="220px"><input type="text" size="32" name="username" id="username" autofocus required/></td>
                       
                    </tr>
                    <tr>
                    <td align="left"><label for="password">Password</label></td>
      <td> <input type="password" size="32" name="password" id="password" class="password" autofocus required/> </td>
                    </tr>
                    <tr>
                      
                      <td align="left"><label for="lname">Last Name</label></td>
                        <td><input type="text" size="32" name="lname" autofocus required/></td> 
                    </tr>
                    <tr>
                        <td align="left"><label for="fname">First Name</label></td>
                        <td><input type="text" size="32" name="fname" autofocus required/></td>
                    </tr>                  
                    <tr>
                    <td align="left"><label for="mi">MI</label></td>
        <td><input type="text"  size="32" name="mi" autofocus required/></td>
                    </tr>
                    <tr>
                    <td align="left"><label for="sex">Sex</label></td>
        <td align="left"><select name="sex" size="1" style="height: 43px; width: 205px;" autofocus required>
	  <option value=""></option>
	  <option value="Female">Female</option>
	  <option value="Male">Male</option>
	</select>
                       
                        </td>
                    </tr>
                    <tr>
                         <td align="left"><label for="seat">Seat #</label></td>
        <td align="left"><select name="seat" size="1" style="height: 43px; width: 205px;" autofocus required>
        <option value=""></option>
        <?php
            include_once('../classes/Student.php');
            $student = new Student;
            $data = $student->getAvail();
            for($x = 0; $x < $student->countAvail(); $x++){
                echo '<option value="'.$data[$x]['seat'].'">'.$data[$x]['seat'].'</option>';
            }
        ?>
        </select>
                    </tr>              
                    <tr>
                        <li class="buttons">
        <button type="submit">Sign-Up</button>
      </li>
    </ol>
    <?php
    if(isset($_GET['error'])){
    echo '<p style="color: white">[Username already existing]</p>';
    }
    ?>
                        </td>
                    </tr>              
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                                                                                                       
                </table>
            </td>
            <td valign="top">
                <ul class="points">
                    <li>First Name and Last Name are optional</li>
                    
                    <li>all fields are required  </li>
                   
                </ul>
            </td>
        </tr>
        <tr bgcolor="#C0C0C0">
            <td>&nbsp;</td>
            <td colspan="2">
            </form>
  <form action="../index.php" method="post" style="background-color: transparent">
    <button style="top: 375px; left: 20px; position: absolute;" class="buttons" type="submit" align="left">log-in</button>
  </form>           
            </td>
        </tr>
       
    </table>
</body>
</html>
